package model.commands.keyboard;

import model.commands.AbstractCommand;

public class KeyboardPress extends AbstractCommand {

	private Integer keyCode;
	
	@Override
	public void execute() {
		try {
			robot.keyPress(keyCode);
			robot.keyRelease(keyCode);
			propertyChangeSupport.firePropertyChange(EXECUTION_FINISHED, null, this);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
	
	@Override
	public void setParams(Object[] params) {
		keyCode = (Integer)params[0];
	}

	public Integer getKeyCode() {
		return keyCode;
	}

}
